<?php
namespace App\Http\Controllers\Home;
use App\Http\Controllers\Controller;
class ShenjianController extends Controller{
	public function index(){
		// header( "Content-type:text/html;Charset=utf-8" );
		$starttime=date('Y-m-d',time()-7*86400);
        $endtime=date('Y-m-d',time());
        $url='https://api.shenjian.io/';
        $parm['appid']='49eee0d8c17163737d5e1a8e0fcfd0a8';
        $parm['code']='000001';
        $parm['index']='false';
        $parm['k_type']='day';
        $parm['fq_type']='qfq';
        $parm['start_date']=$starttime;
        $parm['end_start']=$endtime;
        $curl=curl_init();
		
		curl_setopt($curl,CURLOPT_URL,$url);
		curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,FALSE);
		curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,FALSE);
		if(!empty($parm)){
			curl_setopt($curl,CURLOPT_POST,1);
			curl_setopt($curl,CURLOPT_POSTFIELDS,$parm);
		}
		curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
		$results=curl_exec($curl);
		curl_close($curl);
		var_dump($results);die;
        return $results;

        // preg_match_all("/<tr><td><div><div>.*<\/div><div>(.*)<\/div><div>.*<\/div><div>.*<\/div><div>.*<\/div><\/div><\/td>/isU",$result,$matchs);
        // var_dump($matchs);
        
	}
}